package net.joyphper.commons.security;

import java.util.Date;
import java.util.Set;

import net.joyphper.enums.UserStatus;


public class Auth implements java.io.Serializable {
		
		private static final long serialVersionUID = 1L;
		private Long id;					//唯一标识
		private String loginName; 			//用户名
		private UserStatus status;			//用户状态
		private String sid;					//用户登录标识
		private Date lastLoginTime;
		
		private Set<String> resources;		//用户所拥有的资源
		private Set<Long> roles;			//用户所拥有的角色
		
		public Auth(Long id,String loginName,UserStatus status,Date lastLoginTime,Set<String> resources,Set<Long> roles){
			this.id=id;
			this.loginName = loginName;
			this.status = status;
			this.lastLoginTime=lastLoginTime;
			this.resources = resources;
			this.roles = roles;
		}
		
		public Long getId() {
			return id;
		}
		public void setId(Long id) {
			this.id = id;
		}

		public String getLoginName() {
			return loginName;
		}

		public void setLoginName(String loginName) {
			this.loginName = loginName;
		}

		public UserStatus getStatus() {
			return status;
		}
		public void setStatus(UserStatus status) {
			this.status = status;
		}
		public Date getLastLoginTime() {
			return lastLoginTime;
		}
		public void setLastLoginTime(Date lastLoginTime) {
			this.lastLoginTime = lastLoginTime;
		}
		public String getSid() {
			return sid;
		}
		public void setSid(String sid) {
			this.sid = sid;
		}
		public Set<String> getResources() {
			return resources;
		}
		public void setResources(Set<String> resources) {
			this.resources = resources;
		}

		public Set<Long> getRoles() {
			return roles;
		}

		public void setRoles(Set<Long> roles) {
			this.roles = roles;
		}
}
